<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
	<title>维保单位人员</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel="stylesheet" type="text/css" href="../../css/style.css">
	<script type="text/javascript" src="../../js/jquery-1.8.2.js"></script>
	<script type="text/javascript" src="../../js/dialog/jquery.artDialog.source.js?skin=default"></script>
	<script type="text/javascript" src="../../js/dialog/plugins/iframeTools.source.js"></script>
	<script type="text/javascript" src="../../js/jquery.ztree.all-3.5.min.js"></script>
	<script type="text/javascript" src="../../js/datepicker/WdatePicker.js"></script>
	<script type="text/javascript" src="../../js/jquery.form.js"></script>
	<script type="text/javascript" src="../../js/jquery.page.js"></script>
	<script type="text/javascript" src="../../js/base.js"></script>
	<style>
	.inputText{padding:1px;}
	</style>
</head>
<body class="app">
	<h3>维保单位人员</h3>
	<form class="search" id="search" name="search" method="post">
		<div class="tbdiv">
		<table>
			<tr>
				<th>维保单位：</th>
				<td colspan="4"><select name="serviceCode"></select></td>
			</tr>
			<tr>
				<th>维保人单位编号：</th>
				<td><input type="text" class="inputText" name="serUserCode" value="" style="width:110px;"/></td>
				<th>维保人员名称：</th>
				<td><input type="text" class="inputText" name="serUserName" value="" style="width:110px;"/></td>
				<td align="right"><input type="submit" value="查询" class="inputButton"/></td>
			</tr>
		</table>
		</div>
	</form>
	<div id="list"></div>
	<div class="optionlink">
		<span id="btnAdd">【添加信息】</span>
		<span id="btnDel">【删除所选】</span>
	</div>
	<div id="view" style="width:500px;display:none;">
		<form id="saveForm" name="saveForm" action="wbdwry_save.action" method="post">
		<input type="hidden" name="serUserId" />
		<input type="hidden" name="serUserFlag" />
		<input type="hidden" name="serUserAddDate" />
		<input type="hidden" name="serUserDeleteDate" />
		<input type="hidden" name="serSuperiorUnit" />
		<dl class="view" style="margin-top:5px;">
			<dt>维保人员编号：</dt>
			<dd id="lh_serUserCode">
				<input type="text" class="inputText" name="serUserCode" style="width:110px;" />
			</dd>
			<dt>维保人员姓名：</dt>
			<dd>
				<input type="text" class="inputText" name="serUserName" style="width:120px;" />
			</dd>
			<dt>维保人员密码：</dt>
			<dd>
				<input type="password" class="inputText" name="serUserPass" style="width:110px;" />
			</dd>
			<dt>性别：</dt>
			<dd>
				<select class="inputText" name="serUserSex" style="width:124px;padding:2px;">
					<option value="0">男</option>
					<option value="1">女</option>
				</select>
			</dd>
			<dt>身份证号：</dt>
			<dd>
				<input type="text" class="inputText" name="idCardNumber" style="width:110px;" />
			</dd>
			<dt>从业证号：</dt>
			<dd>
				<input type="text" class="inputText" name="practitioners" style="width:120px;" />
			</dd>
			<dt>参加工作时间：</dt>
			<dd>
				<input type="text" class="inputText Wdate" onfocus="WdatePicker()" name="workingTime" style="width:112px;padding:0px;" readonly="readonly" />
			</dd>
			<dt>调入本单位时间：</dt>
			<dd>
				<input type="text" class="inputText Wdate" onfocus="WdatePicker()" name="transferredTime" style="width:122px;padding:0px;" readonly="readonly" />
			</dd>
			<dt>籍贯：</dt>
			<dd>
				<input type="text" class="inputText" name="hometown" style="width:110px;" />
			</dd>
			<dt>家庭住址：</dt>
			<dd>
				<input type="text" class="inputText" name="address" style="width:120px;" />
			</dd>
			<dt>所属单位：</dt>
			<dd>
				<select class="inputText" name="serviceCode" style="width:114px;padding:2px;"></select>
			</dd>
			<dt>联系电话：</dt>
			<dd>
				<input type="text" class="inputText" name="serUserPhone" style="width:120px;" />
			</dd>
			<dt>E-mail：</dt>
			<dd>
				<input type="text" class="inputText" name="serUserEmail" style="width:110px;" />
			</dd>
			<dt>是否在职：</dt>
			<dd>
				<select class="inputText" name="serActiveService" style="width:124px;padding:2px;">
					<option value="1">是</option>
					<option value="0">否</option>
				</select>
			</dd>
			<dt class="giant" style="height:68px;">备注：</dt>
			<dd class="giant" style="height:68px;">
				<textarea class="inputText" name="remark" style="width:365px;height:60px;"></textarea>
			</dd>
			<div class="cl"></div>
		</dl>
		</form>
	</div>
	
	<script type="text/javascript">
	var view = function(data){
		$('#saveForm').resetForm();
		document.saveForm.serUserId.value = "";
		document.saveForm.serUserFlag.value = "";
		document.saveForm.serUserAddDate.value = "";
		document.saveForm.serUserDeleteDate.value = "";
		document.saveForm.serSuperiorUnit.value = "";
		$.dialog({
			id:'viewdialog',
			title:'信息查看-维保单位人员',
			lock:true,
			zIndex:99,
			padding:'5px 8px 5px 5px',
			width:'100%',
			height:'100%',
			content:document.getElementById('view'),
			button:[{
				name:"保存",
				focus:true,
				callback:function(){
					$('#saveForm').submit();
				}
			}]
		});
		if(data!=null){
			$('#lh_serUserCode').html('<label name="serUserCode"></label>');
		}else{
			$('#lh_serUserCode').html('<input type="text" class="inputText" name="serUserCode" style="width:110px;" />');
		}
		$('#saveForm').json2form(data);
	}
	$(function(){
		$('select[name=serviceCode]').selectload('../../common/serviceunit_select.action','serviceCode','serviceName');
		$('#saveForm').ajaxForm({
			success:function(data){
				$('#list').page('show');
			}
		});
		//分页列表
		$('#list').page({
			url:'wbdwry_search.action',
			config:'pageinfo,record,first,last,next,prev,jump',
			items:[{
				name:'serUserId',
				type:'checkbox',
				width:13
			},{
				title:'维保人员名称',
				name:'serUserName'
			},{
				title:'联系电话',
				name:'serUserPhone'
			},{
				title:'性别',
				name:'serUserSex',
				irender:function(row){
					return row.serUserSex==0?'男':'女';
				}
			},{
				title:'所在单位',
				name:'serviceCode'
			},{
				title:'详情',
				render:function(row){
					$a = $('<a href="javascript:void(0)")">【详细】</a>');
					$a.click(function(){
						view(row);
					});
					return $a;
				}
			}]
		});

		$('#btnAdd').click(function(){
			view(null);
		});
		$('#btnDel').click(function(){
			$.dialog.confirm('您确认删除所选人员吗？',function(){
				var ids = $('#list').data('checked').join(',');
				$.post('wbdwry_del.action',{ids:ids},function(data){
					$('#list').page('show');
				});
			});
		})
		$('#saveForm').ajaxForm({
			success:function(data){
				$('#list').page('show');
			}
		});
	});
	</script>
</body>
</html>